const oldLog = console.log
const oldInfo = console.info
const oldError = console.error
console.log = function()
{
  const args = Array.prototype.slice.call(arguments)
  let cb = args[args.length - 1]
  let pays = args.slice(0,args.length - 2)
  oldLog.apply(null,pays)
  typeof cb === 'function' && cb(pays)
}
console.info = function()
{
  const args = Array.prototype.slice.call(arguments)
  let cb = args[args.length - 1]
  let pays = args.slice(0,args.length - 2)
  oldInfo.apply(null,pays)
  typeof cb === 'function' && cb(pays)
}

console.error = function()
{
  const args = Array.prototype.slice.call(arguments)
  let cb = args[args.length - 1]
  let pays = args.slice(0,args.length - 2)
  oldError.apply(null,pays)
  typeof cb === 'function' && cb(pays)
}
